#include "publicstruct.h"
#include "Format.h"

string timestampToString(long timestamp)
{
    time_t current_time = static_cast<time_t>(timestamp);
    tm *time_info = localtime(&current_time); // tm结构体中存储了年月日时分秒
    string tmp = util::Format("{0}-{1}-{2} {3}:{4}:{5}",
                              time_info->tm_year + 1900, time_info->tm_mon + 1, time_info->tm_mday, time_info->tm_hour, time_info->tm_min, time_info->tm_sec);
    return tmp;
}